package com.landcode.land.service.hi.service.impl;

import com.landcode.land.service.hi.dao.UserMapper;
import com.landcode.land.service.hi.model.Test;
import com.landcode.land.service.hi.model.User;
import com.landcode.land.service.hi.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User getUserName(long id) {
//        return userMapper.selectByPrimaryKey(id);
        return userMapper.selectById(id);
    }

    @Override
    public int insertUser(User user) {
        return userMapper.insert(user);
    }

    @Override
    public List<Test>  getUserTest(String userName) {
        return userMapper.selectUserTest(userName);
    }

    @Override
    public List<User> getUserList() {
        return userMapper.selectUserList();
    }
}
